import { Singer } from '../../entities/singer.entity';
import { ApiProperty } from '@nestjs/swagger';
import { Type } from 'class-transformer';
import { IsInt, IsOptional, IsString, Min } from 'class-validator';
import { PageOptionsDto } from '../page.dto';
import { CommentSinger } from '../../entities/comment.entity';

export class PageSingerItemtDto extends Singer {
  @ApiProperty({
    description: '当前页包含数量',
    required: false,
    default: 10,
  })
  @Type(() => Number)
  @IsInt()
  @Min(1)
  readonly pageSize: number = 10;

  @ApiProperty({
    description: '当前页包含数量',
    required: false,
    default: 1,
  })
  @Type(() => Number)
  @IsInt()
  @Min(1)
  readonly pageNo: number = 1;
}

export class PagerDto extends PageOptionsDto {
  @ApiProperty({
    required: false,
    description: '评论id',
  })
  @IsString()
  @IsOptional()
  id?: '';

  @IsOptional()
  @ApiProperty({
    required: false,

    description: '是否已审批',
  })
  approved: string;

  @IsOptional()
  @ApiProperty({
    required: false,
    description: '评论内容',
  })
  content: string;

  @IsOptional()
  @IsString()
  @ApiProperty({
    example: '',
    required: false,
    description: '歌手id',
  })
  singerId: '';

  @IsOptional()
  @IsString()
  @ApiProperty({
    example: '',
    required: false,
    description: '用户id',
  })
  userId: string;
}

export class CommentSingerDto {
  @ApiProperty({
    required: false,
    description: '评论id',
  })
  @IsString()
  @IsOptional()
  id?: '';

  @IsOptional()
  @ApiProperty({
    required: false,

    description: '是否已审批',
  })
  approved: '1';

  @IsOptional()
  @ApiProperty({
    required: false,
    description: '评论内容',
  })
  content: string;

  @IsOptional()
  @IsString()
  @ApiProperty({
    example: '',
    required: false,
    description: '歌手id',
  })
  singerId: '';
}
